home *** CD-ROM | disk | FTP | other *** search
- June 9, 1989
-
-
-
- **********************************************
- * *
- * D R A W F I L L *
- * *
- * version 2.0 *
- * *
- * (c) 1989 Richard Biffl *
- * *
- **********************************************
-
-
-
- DrawFill is a programming tool to help design graphic fill patterns for the
- Borland Graphics Interface (BGI) used by Borland's Turbo languages.
-
- The command-line syntax for running DrawFill is:
-
- DRAWFILL [D=<driver>] [M=<mode>] [P=<path>] [R] [/A] [/C] [/R]
- [/L] [/"<K>["]]
-
- Items in square brackets (e.g., [R]) are optional. (All
- parameters are optional.) Items in corner brackets (e.g.,
- <driver>) should be replaced as indicated in the detailed
- descriptions of the parameters. Case is ignored. So is the
- order of the parameters; but if the same parameter occurs more
- than once, the last instance takes effect. Parameters are
- separated by a space or a tab.
-
- Command-line parameters:
-
- D=<driver> Driver specification
-
- M=<mode> Mode-number specification
-
- P=<path> Path to screen driver file (.BGI) and
- LITT.CHR
-
- R RAM-resident mode
-
- /A /C /R /L /"<K>" Hot-key specifiers, for RAM-resident
- mode
-
- Usage of these parameters is described in detail in a later section of this
- document.
-
-
-
- FILL PATTERNS
-
- An important element of the Borland Graphics Interface is the "fill pattern."
- A fill pattern is a pattern eight pixels wide and eight pixels high, which is
- repeated like a wallpaper pattern to fill part of the screen. Fill patterns
- make any graphical output more lively, and they are especially useful in
- monochrome graphics as substitutes for colors.
-
- The BGI contains the following procedures that paint fill patterns on the
- screen:
-
- Bar Fills a rectangular area with the current fill
- style and fill color.
-
- Bar3D Draws a three-dimensional bar and fills its face
- with the current fill style and fill color.
-
- FillEllipse Draws an ellipse and fills it with the current
- fill style and fill color.
-
- FillPoly Draws a polygon and fills it with the current
- fill style and fill color.
-
- FloodFill Fills any bounded region with the current fill
- style and fill color.
-
- PieSlice Draws a pie slice and fills it with the current
- fill style and fill color.
-
- Sector Draws an elliptical sector and fills it with the
- current fill style and fill color.
-
- By default, the fill style is solid and the fill color is the maximum color in
- the current palette. The fill pattern can be set by calling either of the
- BGI's following two procedures:
-
- SetFillStyle Sets a pre-defined fill pattern (see Borland
- manual for descriptions).
-
- SetFillPattern Sets a user-defined fill pattern.
-
- SetFillPattern defines a new fill pattern from a pattern definition and a
- color. The pattern is defined in an array of 8 bytes, one byte for each row
- of pixels. Each byte's value is the sum of the values of the lit pixels in
- the row. The values of the pixels, from left-most pixel to right-most, are
-
- decimal notation: 128, 64, 32, 16, 8, 4, 2, 1
- hexadecimal notation: $80, $40, $20, $10, $08, $04, $02, $01
-
- For example, a fill pattern defined by (0,0,0,0,0,0,0,0) does not light any
- pixels. A fill pattern of (255,255,255,255,255,255,255,255) lights all
- pixels. (3,3,3,3,3,3,3,3) draws vertical lines two pixels thick; the pixel
- with value 2 and the pixel with value 1 are both lit in each row.
- (0,0,0,255,0,0,0,255) draws horizontal lines on every fourth row of pixels.
-
- SetFillPattern allows the creation of fill patterns that are more interesting
- than straight lines. Sketching such patterns on graph paper, though, and
- manually calculating their pixel-row values, is a tedious and error-prone
- task. DrawFill was made to simplify the process.
-
-
-
- USING DRAWFILL
-
- DrawFill lets you concentrate on creativity instead of bit values. You move a
- circular cursor around an eight-by-eight grid, toggling pixels on or off as
- you go. The pattern you are creating, and its changing values, are displayed
- simultaneously next to the grid. You can scroll the whole pattern, invert it,
- or change its colors until you see just what you want for your own program.
- The values you need will all be on the screen, ready to copy into your
- program. If you make DrawFill resident in memory, it will even do some of the
- copying for you.
-
- When DrawFill starts, a command menu appears at the bottom of the screen. The
- command menu lists all of the available command keys, the current state of all
- toggle switches, and the current graphics driver and graphics mode. The
- command keys are simple:
-
- <arrow keys> Move the circular cursor from pixel to pixel on
- the drawing grid, when Scroll Lock is OFF. When
- Scroll Lock is ON, the arrow keys scroll the
- whole pattern through the drawing grid.
-
- Home, End Move the cursor to the left-most and right-most
- columns, respectively.
-
- PgUp, PgDn Move the cursor to the top-most and bottom-most
- rows, respectively.
-
- <spacebar> Toggles the current pixel on or off.
-
- Ctrl-Home Erases the current fill pattern and returns the
- cursor to the top-left pixel.
-
- Esc Exits from DrawFill.
-
- Scroll Lock When ON, allows the user to scroll the fill
- pattern up, down, left, or right, using the
- arrow keys.
-
- NOTE: Take care when using Scroll Lock in
- DrawFill's resident mode, if your keyboard has a
- Scroll Lock indicator. When DrawFill pops up,
- it saves the status of the toggle keys, which is
- restored when DrawFill pops back down. However,
- there is no way (known to me) to restore the
- status of the Scroll Lock indicator light on
- your keyboard. Your light may therefore
- indicate the opposite of your computer's Scroll
- Lock status. To prevent this annoyance, return
- to DrawFill's original Scroll Lock status before
- exiting from DrawFill when it is memory-
- resident.
-
- H Toggles hexadecimal mode or decimal mode for
- representing the numerical values of the fill
- pattern. Hexadecimal values are preceded by a
- dollar sign ($), as in Turbo Pascal.
-
- M Toggles the graphics mode for the current screen
- driver. The mode number is defined by the BGI
- driver; it is NOT the same as the ROM BIOS's
- mode number.
-
- F Toggles the color of the fill pattern.
-
- S Toggles the foreground color of the screen
- (other than the pixels which compose the fill
- pattern).
-
- B Toggles the background color of the screen.
-
- I Inverts the fill pattern, so that pixels that
- were lit are turned off and pixels that were off
- are turned on.
-
- W Writes the code for the fill pattern as it exits
- DrawFill (available in resident mode only). The
- pattern will be written from the point where the
- cursor was when you popped DrawFill up.
-
-
-
- COMMAND-LINE PARAMETERS
-
- The command-line syntax for running DrawFill is:
-
- DRAWFILL [D=<driver>] [M=<mode>] [P=<path>] [R] [/A] [/C] [/R]
- [/L] [/"<K>["]]
-
- Items in square brackets (e.g., [R]) are optional. (All
- parameters are optional.) Items in corner brackets (e.g.,
- <driver>) should be replaced as indicated in the detailed
- descriptions of the parameters. Case is ignored. So is the
- order of the parameters; but if the same parameter occurs more
- than once, the last instance takes effect. Parameters are
- separated by a space or a tab.
-
-
-
- D=<driver> Driver specification
-
- By default, DrawFill automatically uses the Borland BGI driver
- that can provide the highest-quality graphics output on your
- system. The D=<driver> parameter overrides the default driver.
-
- The parameter specifies a Borland driver when <driver> is the
- NUMBER (NOT the filename) of the appropriate Borland driver.
- Borland drivers and their numbers are listed in your Borland
- manual.
-
- NOTE: The IBM 8514 graphics driver and the AT&T 400-line driver
- CANNOT be installed automatically; if you are using one of them,
- you MUST specify either D=6 or D=8, respectively.
-
- Example:
-
- DRAWFILL D=8
- Initializes ATT400 driver (BGI driver
- #8).
-
- You can also use the D=<driver> parameter to use a non-Borland
- screen driver. For example, if your system has the Spiffy
- Graphics Array, and its manufacturer provided a driver for the
- Borland Graphics Interface, you can use it by specifying the
- FILENAME of the driver (NOT a number) in place of <driver>. The
- DOS path to the driver should be included if the driver is not
- in the current directory or in the directory specified by the
- P=<path> parameter.
-
- Examples:
-
- DRAWFILL D=SGA.BGI
- DrawFill uses the custom screen driver
- in the file SGA.BGI.
-
- DRAWFILL D=\SPIFFY\SGA.BGI
- DRAWFILL D=SGA.BGI P=\SPIFFY
- DrawFill uses the driver SGA.BGI in the
- SPIFFY directory of the current disk.
-
- If the D=<driver> parameter specifies an invalid driver, the
- error may not be detectable by DrawFill and the screen may go
- blank. If so, try pressing Esc to escape back to the DOS
- prompt. If your computer seems hopelessly locked up, reboot it
- immediately to prevent the possibility of hardware damage.
-
-
-
- M=<mode> Mode-number specification
-
- By default, DrawFill tries to use the screen driver's mode with
- the highest graphics quality. You can override the default mode
- with the M=<mode> parameter, where <mode> is a NUMBER. The
- valid modes for each Borland screen driver are listed in your
- Borland manual. A specification of an invalid mode is ignored.
-
- Example:
-
- DRAWFILL M=0
- Initializes the default driver in mode
- 0, which usually has the lowest resolution but
- sometimes (e.g., on the CGA) has more colors
- than the highest-resolution mode.
-
- NOTE: Be sure to use Borland's mode number with the M=<mode>
- parameter, NOT the ROM BIOS mode number.
-
- NOTE: You can also change modes from within DrawFill, by
- pressing <M>.
-
-
-
- P=<path> Path to screen driver file (.BGI) and LITT.CHR
-
- DrawFill requires the appropriate driver's .BGI file, and the
- LITT.CHR font file. (These files are not included with
- DrawFill; they are included with all Borland languages that use
- the Borland Graphics Interface.)
-
- By default, if the .BGI file is not found in the current
- directory, the program will terminate with an error message. If
- the LITT.CHR file is not found, the program will run using only
- the default font, which will make only a cosmetic difference.
-
- A path to the .BGI and LITT.CHR files may be specified on the
- DrawFill command line with the P=<path> parameter.
-
- Example:
-
- DRAWFILL P=C:\TP\TPGRAPH
- Looks in the TPGRAPH subdirectory of the
- TP directory on drive C.
-
- DRAWFILL P=..
- Looks in the parent directory above the
- current subdirectory.
-
-
-
- R RAM-resident mode
-
- The R parameter loads DrawFill into random-access memory, where
- it resides while you run other programs. You can pop DrawFill
- up by pressing a hot-key combination.
-
- By default, the hot-key combination is <D> <Right Shift> <Alt>.
- (You can remember this because "DRA" are the first three letters
- of "DRAwFill.") DrawFill will pop up when you hold down the
- <Right Shift> and <Alt> keys while you press <D>. You can
- change the hot-key combination with command-line parameters, as
- described below.
-
- DrawFill has a special capability in resident mode. It can
- write the code for the pattern you create directly into whatever
- program you were running when you popped DrawFill up. Press <W>
- in resident mode and DrawFill will pop down, writing the code
- for your fill pattern to your screen. This is handy when you
- pop DrawFill up from an editor while writing a program that will
- use your fill pattern.
-
- DrawFill uses almost 85,000 bytes of memory in resident mode.
- It remains resident until you reboot your computer (unless you
- have a memory manager that can release resident programs without
- rebooting).
-
- Example:
-
- DRAWFILL R
- Makes DrawFill resident in memory, and
- reports how much memory it uses and what hot-key
- combination is in effect.
-
- NOTE: Because of limitations on the memory available to save
- the screen, DrawFill can only be popped up from text and CGA-
- graphics modes.
-
-
-
- /A /C /R /L /"<K>" Hot-key specifiers, for RAM-resident mode
-
- The default hot-key combination to pop DrawFill up when it is
- resident is <Right Shift> <Alt> <D>. You can change either the
- hot shift-key combination, or the hot character key, or both.
-
- The shift keys are specified by /A for <Alt>, /C for <Ctrl>, /R
- for <Right Shift>, and/or /L for <Left Shift>. Any combination
- of these four shift keys is permitted.
-
- The character key is specified by /"<K>", where <K> is any
- character from <A> to <Z> or numeral from <0> to <9>. The
- second quotation mark is optional.
-
- If you change only the shift-key combination, or only the
- character key, the default will be used for the other part of
- the hot-key combination.
-
- Examples:
-
- DRAWFILL R /C
- Installs DrawFill in memory, with a hot-
- key combination of <Ctrl> <D>.
-
- DRAWFILL R /"F"
- Installs DrawFill in memory, with a hot-
- key combination of <Alt> <Right Shift> <F>.
-
- DRAWFILL R /C /"F"
- Installs DrawFill in memory, with a hot-
- key combination of <Ctrl> <F>.
-
- The effective hot-key combination will be displayed when
- DrawFill is installed in memory.
-
-
-
- DISCLAIMER OF WARRANTY
-
- DrawFill has been written with care, and I will make an honest effort to
- exterminate any bugs reported by users. Beyond that, however, I specifically
- disclaim all other warranties, expressed or implied, including but not limited
- to implied warranties of merchantability or fitness for any particular
- purpose, with respect to both the software and this documentation. In no
- event shall I be liable for any loss of profit or any other commercial damage,
- nor for any special, incidental, consequential or other damages. I do not
- know of any risk in using DrawFill; but if there is a risk, the user bears it.
-
-
-
- DISTRIBUTION POLICY
-
- DrawFill is protected by United States copyright law and international treaty
- provisions. It is not in the public domain.
-
- You need not pay anything to use DrawFill to create fill patterns for graphics
- programs, either commercial or non-commercial. (You may also use it to doodle
- to your heart's content.) However, you may not incorporate DrawFill itself
- into another program, product, or commercial package, without my prior written
- consent.
-
- You may distribute DrawFill and this documentation, provided that you
- distribute both DRAWFILL.EXE and DRAWFILL.DOC, TOGETHER and UNALTERED. Please
- let me know of any need for patches or revisions. If you must change one of
- the files yourself, you may not distribute a copy of the altered version to
- anyone else.
-
- No distributor may charge for this program or documentation without my prior
- written consent, except that distributors may charge a nominal fee (no more
- than $10) to cover the costs of distribution.
-
- The latest version of DrawFill is available from me for $10. If you tell me
- which version you already have when you place your order, and it IS the latest
- version, I will return your money, unless you tell me you would prefer to
- receive an automatic upgrade when the next version is released.
-
- Happy pixellating!
-
-
-
- **********************************************
- * *
- * Richard Biffl *
- * 2922 28th Street, N.W. *
- * Washington, D.C. 20008 *
- * CompuServe 73607,3043 *
- * *
- **********************************************
-
-
-
- DrawFill was written in Turbo Pascal and Turbo Assembler.
-
- RAM-resident routines are from TSRUnit by Ken L. Pottebaum,
- which accompanied his article, "Creating TSR Programs with Turbo Pascal,"
- Dr. Dobb's Journal vol. 14 no. 5, May 1989.
-
- DrawFill is a trademark of Richard Biffl.
- Turbo Pascal and Turbo Assembler are trademarks
- of Borland International, Inc.
-
- ----------------end-of-author's-documentation---------------
-
- Software Library Information:
-
- This disk copy provided as a service of
-
- The Public (Software) Library
-
- We are not the authors of this program, nor are we associated
- with the author in any way other than as a distributor of the
- program in accordance with the author's terms of distribution.
-
- Please direct shareware payments and specific questions about
- this program to the author of the program, whose name appears
- elsewhere in this documentation. If you have trouble getting
- in touch with the author, we will do whatever we can to help
- you with your questions. All programs have been tested and do
- run. To report problems, please use the form that is in the
- file PROBLEM.DOC on many of our disks or in other written for-
- mat with screen printouts, if possible. The P(s)L cannot de-
- bug programs over the telephone.
-
- Disks in the P(s)L are updated monthly, so if you did not get
- this disk directly from the P(s)L, you should be aware that
- the files in this set may no longer be the current versions.
-
- For a copy of the latest monthly software library newsletter
- and a list of the 1,800+ disks in the library, call or write
-
- The Public (Software) Library
- P.O.Box 35705 - F
- Houston, TX 77235-5705
- (713) 665-7017
-